package com.bristua.barcode.supplier.controller;

import com.bristua.barcode.common.bean.Result;
import com.bristua.barcode.common.util.HandleResultUtil;
import com.bristua.barcode.supplier.biz.QuerySupplierQRCodeBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class QuerySupplierQRCodeController {

    @Autowired
    private QuerySupplierQRCodeBiz querySupplierQRCodeBiz;

    @PostMapping(value = "/supplier/query/qrcode/{supplierId}")
    public Result querySupplierQRCode(@PathVariable(value = "supplierId") String supplierId){
        return HandleResultUtil.querySuccessResult(querySupplierQRCodeBiz.queryQrcode(supplierId));
    }

    @PostMapping(value = "/supplier/query/qrcode/{isbind}/{pageNo}/{pageSize}")
    public Result querySupplierQRCode(@PathVariable(value = "isbind") Integer isbind,@PathVariable(value = "pageNo") Integer pageNo,@PathVariable(value = "pageSize")Integer pageSize){
        return HandleResultUtil.querySuccessResult(querySupplierQRCodeBiz.queryQrcode(isbind,pageSize,pageNo));
    }
}
